<template>
	<!-- 页面标题 -->
	<span class="crumbs">{{ route.meta?.title }}</span>
	<!-- 搜索框 -->
	<ComSearch @handle-search="emit('handleSearch', $event)" ref="ComSearchRef" />
	<!-- 按钮 -->
	<div class="btns">
		<i :class="['EachApp', 'EachApp_jian1', 'hover']" @click="emit('handleAdd')"></i>
        <slot></slot>
    </div>
</template>
<script lang="ts" setup>
defineProps({
    btnName: { type: String, default: () => { return '新建' } }
})
import mitt from "@/utils/bus";
const route = useRoute();
const emit = defineEmits(['handleSearch', 'handleAdd']);
const ComSearchRef = ref(null);
// 删除关键字
mitt.on("handleDelete", (value) => {
	if (ComSearchRef.value) {
		ComSearchRef.value.searchKey = value;
	}
});
</script>